<?php

/**
 * Task form base class.
 *
 * @method Task getObject() Returns the current form's model object
 *
 * @package    lbreminder
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseTaskForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'          => new sfWidgetFormInputHidden(),
      'name'        => new sfWidgetFormInputText(),
      'user_id'     => new sfWidgetFormPropelChoice(array('model' => 'sfGuardUser', 'add_empty' => false)),
      'type_id'     => new sfWidgetFormPropelChoice(array('model' => 'TaskType', 'add_empty' => false)),
      'description' => new sfWidgetFormInputText(),
      'location_id' => new sfWidgetFormPropelChoice(array('model' => 'TaskLocation', 'add_empty' => false)),
      'priority_id' => new sfWidgetFormPropelChoice(array('model' => 'TaskPriority', 'add_empty' => false)),
      'year'        => new sfWidgetFormInputText(),
      'month'       => new sfWidgetFormInputText(),
      'day'         => new sfWidgetFormInputText(),
      'hour'        => new sfWidgetFormInputText(),
      'minute'      => new sfWidgetFormInputText(),
      'ampm'        => new sfWidgetFormInputText(),
      'created_at'  => new sfWidgetFormDateTime(),
      'updated_at'  => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'          => new sfValidatorPropelChoice(array('model' => 'Task', 'column' => 'id', 'required' => false)),
      'name'        => new sfValidatorString(array('max_length' => 255)),
      'user_id'     => new sfValidatorPropelChoice(array('model' => 'sfGuardUser', 'column' => 'id')),
      'type_id'     => new sfValidatorPropelChoice(array('model' => 'TaskType', 'column' => 'id')),
      'description' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'location_id' => new sfValidatorPropelChoice(array('model' => 'TaskLocation', 'column' => 'id')),
      'priority_id' => new sfValidatorPropelChoice(array('model' => 'TaskPriority', 'column' => 'id')),
      'year'        => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'month'       => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'day'         => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'hour'        => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'minute'      => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'ampm'        => new sfValidatorString(array('max_length' => 2, 'required' => false)),
      'created_at'  => new sfValidatorDateTime(array('required' => false)),
      'updated_at'  => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('task[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Task';
  }


}
